package com.miguo.bean;

import java.io.Serializable;

import org.json.JSONException;
import org.json.JSONObject;

public class AuthLoginBean implements Serializable {

	private static final long serialVersionUID = 1L;

	private String token;

	private Long token_expires_time;

	public AuthLoginBean() {
	}

	public AuthLoginBean(String token, Long token_expires_time) {
		this.token = token;
		this.token_expires_time = token_expires_time;
	}

	public AuthLoginBean(String login_data) {
		JSONObject data = null;
		try {
			data = new JSONObject(login_data);
			token = data.isNull("token") ? "0" : data.getString("token");
			token_expires_time = data.isNull("token_expires_time") ? 0 : data
					.getLong("token_expires_time");
		} catch (JSONException e) {
			e.printStackTrace();
		}
	}

	public Long getTokenExpiresTime() {
		return token_expires_time;
	}

	public void setTokenExpiresTime(Long token_expires_time) {
		this.token_expires_time = token_expires_time;
	}

	public String getToken() {
		return token;
	}

	public void setToken(String token) {
		this.token = token;
	}

}
